package org.ushio.nchu_22201406.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.sql.Date;

@Mapper
public interface balanceDao {


    @Update("UPDATE business_information SET Balance = Balance + #{amount} WHERE Phone_Number = #{phoneNumber}")
    void updateBalanceByPhoneNumber(@Param("phoneNumber") String phoneNumber, @Param("amount") BigDecimal amount);
    @Insert("INSERT INTO phone_bill_record (Phone_Number, Bill_Amount, Bill_Date, Payment_Status) " +
            "VALUES (#{phoneNumber}, #{billAmount}, #{billDate}, #{paymentStatus})")
    void insertPhoneBillRecord(@Param("phoneNumber") String phoneNumber,
                               @Param("billAmount") BigDecimal billAmount,
                               @Param("billDate") Date billDate,
                               @Param("paymentStatus") long paymentStatus);
}
